<template>
  <div class="updata">
    <van-loading size="39px" vertical type="spinner" v-if="!updatalist.length"
      >加载中...</van-loading
    >
    <div class="list" v-else>
      <div class="item" v-for="item in updatalist" :key="item.comic_id">
        <div class="img" @click="gotoPassage(item.comic_id)">
          <img :src="item.horizontal_cover" alt="" />
        </div>
        <div class="title">
          <h3>{{ item.title }}</h3>
          <div class="right">
            <p @click="gotoPassage(item.comic_id)">查看全集</p>
            <span class="into iconfont icon-youjiantou"></span>
          </div>
        </div>
        <span class="replace"
          >更新至第{{ item.total }}话&nbsp;{{ item.recommendation }}</span
        >
        <!-- <div class="like">
          <span>520</span>
          <span class="icon iconfont icon-dianzan"></span>
        </div> -->
      </div>
    </div>
    <FootCom/>

  </div>
</template>

<script>
import FootCom from "../components/FootCom.vue"

export default {
  data() {
    return {
      updatalist: [],
    };
  },
  created() {
    // this.axios.get("/GetClassPageComicsRank?id=256").then((res) => {
    //   this.updatalist = res.data.data.rank;
    //   console.log(this.updatalist);
    // });

      this.axios
      .get("/GetClassPageSixComics?id=136&pageNum=1&pageSize=15&isAll=0")
      .then((res) => {
        // console.log(res);
        this.updatalist = res.data.data.roll_six_comics;
        // console.log(this.updatalist);
      });

  },
  methods: {
    gotoPassage(comic_id) {
      this.$router.push({
        path: "/passage",
        query: {
          id: comic_id,
        },
      });
    },
  },
  components:{
    FootCom
  }
};
</script>

<style lang="scss" scoped>
.updata {
  padding: 0px 12px;
  .list {
    padding-bottom: 50px;
    .item {
      width: 100%;
      padding: 10px 0px;
      position: relative;
      .img {
        width: 100%;
        img {
          width: 100%;
          height: 205px;
        }
      }
      .title {
        display: flex;
        justify-content: space-between;
        align-items: center;
        h3 {
          font-size: 14px;
          color: #333;
          height: 32px;
          line-height: 32px;
          font-weight: bold;
        }
        .right {
          display: flex;
          justify-content: space-between;
          align-items: center;
          p {
            font-size: 12px;
            color: #666;
          }
          .into {
            display: inline-block;
            margin-top: 2px;
            font-size: 12px;
            color: #666;
          }
        }
      }
      .replace {
        font-size: 12px;
        color: #666;
      }
      .like {
        width: 52px;
        height: 26px;
        line-height: 24px;
        text-align: center;
        background-color: rgba(0, 0, 0, 0.4);
        border-radius: 20px;
        position: absolute;
        top: 20px;
        right: 15px;
        span {
          font-size: 12px;
          color: #fff;
        }
        .icon {
          font-size: 14px;
          margin-left: 5px;
        }
      }
    }
  }
  .van-loading--vertical {
    margin-top: 300px;
  }
}
</style>